Ext.define('Admin.view.trade.TradeListController', {
	        extend : 'Admin.app.CrudController',
	        alias : 'controller.tradelist',

	        onTradeListRefresh : function(view, record, params) {
		        var me = this, vm = me.getViewModel();
		        var store = vm.getStore('tradeListStore');
		        // store.proxy.extraParams = {
		        // id : record.data.id
		        // };
		        store.reload();
	        },

	        onInsertClick : function(btn) {
		        var me = this, grid = btn.ownerCt.ownerCt, parent = me.getViewModel().get('record');
		        if (!parent)
			        return;
		        var record = Ext.create(grid.getStore().model, {
			                id : null,
			                name : '新建交易品种',
			                market : parent.data.id
		                });
		        record.store = grid.getStore();
		        me.showDetail(grid.detail, record);
	        },

	        afterDetail : function(record, win) {
		        var me = this, vm = me.getViewModel(), store = vm.getStore('programStore');
		        win.getViewModel().set('programStore', store);
	        },

	        onTradeResult : function(view, rowIndex, colIndex, item, e, record, row) {
	        	var trade = view.ownerCt.ownerCt.ownerCt;
	        	trade.getController().showTradeResult(record.data);
	        }
        });